package com.bookpavilion.chat.netty;


import io.netty.channel.Channel;

import java.util.HashMap;
import java.util.Map;

public class UserChannelRel {
    private static HashMap<String, Channel> manager = new HashMap<>();
    public static void put(String fromId,Channel channel){
        manager.put(fromId,channel);
    }
    public static Channel get(String fromId){
        return manager.get(fromId);
    }
    public static void output(){
        for(Map.Entry<String, Channel> entry : manager.entrySet()){
            System.out.println("User.id:  "+entry.getKey()+", ChannelId: " + entry.getValue().id().asLongText());
        }
    }
}
